package gameElements.role;

import java.awt.Graphics2D;

import CMD.RoleCMD;
import constInterface.BulletKind;

public abstract class Enemy extends Role implements BulletKind
{
	/**
	 * 
	 */
	private static final long serialVersionUID = -905234250168696575L;
	
	private int level = 1;
	private int defend = 10;
	

	private int value = 550;
	
	public boolean isAlive()
	{
		return getBlood()>0? true:false;
	}

	public int getDefend() {
		return defend;
	}

	public void setDefend(int defend) {
		this.defend = defend;
	}

	public int getLevel() 
	{
		return level;
	}

	public void setLevel(int level) 
	{
		this.level = level;
	}

	public Enemy(int realX, int realY , int level) 
	{
		changeRealX(realX);
		changeRealY(realY);
	}
	
	public void hited(int harm)
	{
		setBlood(getBlood() - harm);
		if(!isAlive())
		{
			toExperience();
		}
	}
	public void toExperience()
	{
		((Lead)(RoleCMD.getRoleCMD().getRole(0))).addExperience(value);
	}

	public void drawOther(Graphics2D g) 
	{
		for(int c = 0 ; c < getBullets().size() ; c++)
		{
			if(getBullets().get(c).hited())
			{
				getBullets().remove(c);
			}else
			{
				getBullets().get(c).draw(g);
			}
		}
	}
	
	public void drawJump(Graphics2D g){}
	public void jump(){}

	public abstract void bulletAttack();
	
	
	
}
